From e38efe2bed32ce11db4c42153122d0b7221d681b Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Mon, 4 Oct 2021 13:17:19 -0600 Subject: [PATCH] compatible fixes for qt6 warnings and conflicts. (#728) * quite qt6 yammering about foreach. * avoid name collision with Qt6. * fix warning: type qualifiers ignored on cast result type --- dmtlog.cc | 2 +- gui/map.cc | 2 +- wbt-200.cc | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dmtlog.cc b/dmtlog.cc index 37cbbf574..d37893d0f 100644 --- a/dmtlog.cc +++ b/dmtlog.cc @@ -777,7 +777,7 @@ dmtlog_write() gbfputint32(4, fout); gbfputint32(1, fout); gbfputint32(0x100001, fout); - gbfputuint32((const uint32_t)gpsbabel_time, fout); + gbfputuint32((uint32_t)gpsbabel_time, fout); header_written = 0; this_index = 0; diff --git a/gui/map.cc b/gui/map.cc index 9e1d1b938..e3034bbf1 100644 --- a/gui/map.cc +++ b/gui/map.cc @@ -146,7 +146,7 @@ static QString makePath(const vector & pts) QString path; int lncount = 0; bool someoutput = false; - foreach (const LatLng ll, pts) { + for (const auto& ll : pts) { if (lncount == 0) { if (someoutput) { path.append(QChar(',')); diff --git a/wbt-200.cc b/wbt-200.cc index 8987b23b0..8cf0e5bc9 100644 --- a/wbt-200.cc +++ b/wbt-200.cc @@ -91,7 +91,7 @@ static struct { static void* fd; static FILE* fl; static char* port; -static char* erase; +static char* opt_erase; enum wintec_gps_types { UNKNOWN, WBT200, WBT201, WSG1000 @@ -758,7 +758,7 @@ static void wbt200_data_read() /* Erase data? */ - if (*erase != '0') { + if (*opt_erase != '0') { int f; db(1, "Erasing data\n"); for (f = 27; f <= 31; f++) { @@ -967,7 +967,7 @@ static void wbt201_data_read() } } - if (*erase != '0') { + if (*opt_erase != '0') { /* erase device */ do_simple("@AL,5,6", BUFSPEC(line_buf)); } @@ -1056,7 +1056,7 @@ static void data_read() static QVector wbt_sargs = { { - "erase", &erase, "Erase device data after download", + "erase", &opt_erase, "Erase device data after download", "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr }, }; -- 2.30.2